#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve()
{
    int x, y, a, b, c, d;
    cin >> x >> y >> a >> b >> c >> d;
    cout << ((y % (abs(__gcd(a, -b))) == 0) && (x % (abs(__gcd(d, -c))) == 0) ? "YES" : "NO") << endl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}